package domain.game;

import com.uqbar.vainilla.DeltaState;
import com.uqbar.vainilla.GameComponent;

import domain.scenes.MainGameScene;

public class KeysHandler extends GameComponent<MainGameScene> {

	private static  GameState PLAYING;
	private static GameState GAMEOVER;
	private GameState gameState;
	
	public KeysHandler(){
		PLAYING = new PlayingState(this);
		GAMEOVER = new GameOverState(this);
		this.gameState = new PlayingState(this);

	}
	
	public void update(DeltaState delta){
		super.update(delta);
		this.getGameState().update(delta);
	}

	public GameState getGameState() {
		return gameState;
	}

	public void setGameState(GameState gameState) {
		this.gameState = gameState;
	}
	
	public void transition(double seconds, GameState next){
		this.setGameState(new TransitionState(this, next, seconds));
	}
	public GameState playingState(){
		return PLAYING;
	}

	public GameState gameOverState() {
		return GAMEOVER;
	}
}
